<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>

    class Student{
        constructor(name){
            this.name = name;
        }
        hello(){
            alert('hello')
        }
    }

    class XiaoStudent extends Student{
        constructor(name,grade){
            super(name);
            this.grade = grade;
        }

        myGrade(){
            alert('woshixiaoxuesheng')
        }
    }
    var xiaoming = new Student('xiaoming');
    var xiaohong = new XiaoStudent('xiaohong')
    
</script>
</body>
</html> 